//------------------------------------------------------------------------------
// <copyright file="WindowExtension.cs" company="Damian Antonowicz">
//       copyright © 2010 Damian Antonowicz
// </copyright>
// <author>Damian Antonowicz</author>
// <email>poczta@damianantonowicz.pl</email>
//------------------------------------------------------------------------------

using System.Linq;
using System.Windows;

namespace DAnton.Utilities.Extensions
{
    public static class WindowExtension
    {
        public static void SetOwner(this Window window)
        {
            window.Owner = System.Windows.Application.Current.Windows.Cast<Window>().SingleOrDefault(w => w.IsActive == true);
        }
    }
}
